%{
#include <stdio.h>
#include <stdlib.h>
#include "node.h"
#include "test4.tab.h"
	void yyerror(char*);
%}

%%

[a-z]		{ yylval.sIndex = *yytext - 'a'; return VARIABLE; }
[0-9]+		{ yylval.iValue = atoi(yytext); return INTEGER; }
[-()<>=+*/%;{}]		{ return *yytext; }
">="		return GE;
"<="		return LE;
"=="		return EQ;
"!="		return NE;
"&&"		return AND;
"||"		return OR;
"while"		return WHILE;
"if"		return IF;
"else"		return ELSE;
"print"		return PRINT;
[\t\n]+		;// eliminate the spaces
.			printf("unknown symbol: [%s]\n", yytext);

%%

int yywrap(void) {
	return 1;
}

